package mymvc.ui
{
	import flash.events.Event;
	import flash.utils.Timer;
	
	import mymvc.util.SWFLoader;

	public class SourceManager
	{
		private var loader:SWFLoader;
		private static const manager:SourceManager = new SourceManager();
		private var instance = null;
		
		public function SourceManager()
		{
			loader = new SWFLoader(); 
			loader.Load("mymvc/swf/Fighter.swf");
		}
		
		public static function getInstance():SourceManager{	
			return manager;
		}
		
		public function getClass(className:String):Class{
			loader.addEventListener(Event.COMPLETE,function (){
				instance = loader.GetClass(className);		
			});
			while(instance == null){
				
			}
			
			return instance;		
		} 
	}
}